<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    377. Combination Sum IV
   </h1>
   <p>
    Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.
   </p>
   <p>
    <b>
     Example:
    </b>
   </p>
   <pre>
<i><b>nums</b></i> = [1, 2, 3]
<i><b>target</b></i> = 4

The possible combination ways are:
(1, 1, 1, 1)
(1, 1, 2)
(1, 2, 1)
(1, 3)
(2, 1, 1)
(2, 2)
(3, 1)

Note that different sequences are counted as different combinations.

Therefore the output is <i><b>7</b></i>.
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <b>
     Follow up:
    </b>
    <br>
    What if negative numbers are allowed in the given array?
    <br>
    How does it change the problem?
    <br>
    What limitation we need to add to the question to allow negative numbers?
   </p>
   <p>
    <b>
     Credits:
    </b>
    <br>
    Special thanks to
    <a href="https://leetcode.com/pbrother/">
     @pbrother
    </a>
    for adding this problem and creating all test cases.
   </p>
  </div>
  <div>
   <h1 class="question_title">
    377. 组合总和 Ⅳ
   </h1>
   <p>
    给定一个由正整数组成且不存在重复数字的数组，找出和为给定目标正整数的组合的个数。
   </p>
   <p>
    <strong>
     示例:
    </strong>
   </p>
   <pre>
<em><strong>nums</strong></em> = [1, 2, 3]
<em><strong>target</strong></em> = 4

所有可能的组合为：
(1, 1, 1, 1)
(1, 1, 2)
(1, 2, 1)
(1, 3)
(2, 1, 1)
(2, 2)
(3, 1)

请注意，顺序不同的序列被视作不同的组合。

因此输出为 <strong>7</strong>。
</pre>
   <p>
    <strong>
     进阶：
    </strong>
    <br>
    如果给定的数组中含有负数会怎么样？
    <br>
    问题会产生什么变化？
    <br>
    我们需要在题目中添加什么限制来允许负数的出现？
   </p>
   <p>
    <strong>
     致谢：
    </strong>
    <br>
    特别感谢&nbsp;
    <a href="https://leetcode.com/pbrother/">
     @pbrother
    </a>
    &nbsp;添加此问题并创建所有测试用例。
   </p>
  </div>
 </body>
</html>